<?php

require_once("configuration.php");
require_once("includes/function.php");

$id = isset($_GET['id']) ? intval(sql_injection($_GET['id'])) : 0;

if (is_int($id) && $id > 0) {
    require_once("includes/cart.php");
    $cart = new customers_cart();
    $cart->session_id = $CurrentSession->session_id;
    $cart->product_id = $id;
    $cart->get();
    $cart->status = cart_status::Deleted;
    $cart->quantity = 0;
    $cart->update();
    $mysql->c();
    header("HTTP/1.1 301 Moved Permanently");
    header("location: cart.edit.php");
    exit();
}
require_once("configuration.end.php");
?>